

<template>
   <Row class="">
        <Col span="7" class="margin_form">
            <Card title="初始化功能信息">
                <Form>
                    <FormItem label="输入功能名称">
                        <Input placeholder="输入功能名称(英文)" v-model="FunctionInfo.FunctionName"></Input>
                    </FormItem>
                    <div style="float:right">
                        <Button @click="back">
                            上一步
                        </Button>
                        <Button @click="next">
                            下一步
                        </Button>
                    </div>
                    <div style="clear:right"></div>
                </Form>
            </Card>
        </Col>
    </Row>
</template>
<script lang="ts">
import {
  Vue,
  Component,
  Prop,
  Watch,
  Emit,
  Model,
  Inject,
  Provide
} from "vue-property-decorator";
import { Getter, Action, State, Mutation } from "vuex-class";
declare let require: any;
//TODO 导入搜索接口
//props的属性一般不需要再在类中进行初始化
@Component({
  components: {
    AddStepInfo: (r: any) => require(["../component/AddStepInfo.vue"], r)
  }
})
export default class InitFunction extends Vue {
  FunctionInfo: any = {
    FunctionName: "",
    StepInfo: []
  };
  back() {
    this.$router.push("/");
  }
  next() {
    let ProjectInfo: any = localStorage.getItem("ProjectInfo");
    let temp: string = ProjectInfo == null ? "{}" : ProjectInfo;
    ProjectInfo = JSON.parse(temp);
    ProjectInfo.Functions.push(this.FunctionInfo);
    localStorage.setItem("ProjectInfo", JSON.stringify(ProjectInfo));
    console.log(localStorage.getItem("ProjectInfo"));
    this.$router.push("/inideStep");
  }
}
</script>
<style scoped>
.margin_form {
  margin: 50px 50px;
}
</style>
